﻿using Dyao.Book.Contract;
using Foundation.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Dyao.Book.Entity
{
    /// <summary>
    /// 书籍目录
    /// </summary>
    [Table("BookCatalogue")]
    public class BookCatalogueEntity : IEntity<string>, ICreateOn, IUpdateOn, ICreateBy, IUpdateBy
    {
        /// <summary>
        /// ID
        /// </summary>
        [Required]
        [Column("Id", TypeName = "VARCHAR")]
        [Key]
        public string ID { get; set; }

        /// <summary>
        /// 书籍Id
        /// </summary>
        public string BookId { get; set; }

        /// <summary>
        /// 序号-书籍章节的序号
        /// </summary>
        public int CatalogueSeq { get; set; }

        /// <summary>
        /// 目录名称
        /// </summary>
        [StringLength(50)]
        public string CatalogueName { get; set; }

        /// <summary>
        /// 卷编号
        /// </summary>
        public string VolumeId { get; set; }

        /// <summary>
        /// 卷名
        /// </summary>
        public string VolumeName { get; set; }

        /// <summary>
        /// 是否免费章节
        /// </summary>
        public bool IsFree { get; set; }

        /// <summary>
        /// 爬取完成
        /// </summary>
        public bool CrawlComplete { get; set; }

        /// <summary>
        /// 是否匹配源
        /// </summary>
        public bool IsMatchSource { get; set; }

        /// <summary>
        /// 目标类型
        /// </summary>
        public string SourceKey { get; set; }

        /// <summary>
        /// 正文Link-正版
        /// </summary>
        [StringLength(100)]
        public string ContentLink { get; set; }

        /// <summary>
        /// 关键字,多个以逗号隔开
        /// </summary>*
        [StringLength(500)]
        public string Keyword { get; set; }

        /// <summary>
        /// 字数
        /// </summary>
        public int WordsNumber { get; set; }

        /// <summary>
        /// 用户编号
        /// </summary>
        [Required]
        public int CreateUserId { get; set; }

        /// <summary>
        /// 用户名称
        /// </summary>
        [Required]
        public string CreateUserName { get; set; }

        /// <summary>
        /// 爬取时间
        /// </summary>
        [Required]
        public DateTime CreateDateTime { get; set; }

        /// <summary>
        /// 用户编号
        /// </summary>
        [Required]
        public int UpdateUserId { get; set; }

        /// <summary>
        /// 用户名称
        /// </summary>
        [Required]
        public string UpdateUserName { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [Required]
        public DateTime UpdateDateTime { get; set; }
    }
}
